package com.mineoj.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mineoj.model.entity.QuestionList;
import com.mineoj.model.entity.QuestionListFavour;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mineoj.model.entity.User;

/**
* @author 明月
* @description 针对表【question_list_favour(题单收藏)】的数据库操作Service
* @createDate 2025-04-05 16:35:01
*/
public interface QuestionListFavourService extends IService<QuestionListFavour> {
    /**
     * 帖子收藏
     *
     * @param questionListId
     * @param loginUser
     * @return
     */
    int doQuestionListFavour(long questionListId, User loginUser);

    /**
     * 分页获取用户收藏的帖子列表
     *
     * @param page
     * @param queryWrapper
     * @param favourUserId
     * @return
     */
    Page<QuestionList> listFavourQuestionListByPage(IPage<QuestionList> page, Wrapper<QuestionList> queryWrapper,
                                    long favourUserId);

    /**
     * 帖子收藏（内部服务）
     *
     * @param userId
     * @param questionListId
     * @return
     */
    int doQuestionListFavourInner(long userId, long questionListId);
}
